const fs = require("fs");
//let json  = markFiles("../");
marks("./");
// console.log(json);
async function marks(path) {
  try {
    let  result = {};
    fs.stat(path, (error, stat) => {
      if (error) {
        return error;
      }
      if (stat.isDirectory) {
        let dir = {path.split('/')[]:forDir}
        result =  {...result,...};
      }
      else if(stat.isFile){
        result = let {}

      }
    });
  } catch (error) {
    return { error: error };
  }
}

async function forFile(path,name){
    return {name:path}
}
async function forDir(path){
    try{
    let  result = {};
    fs.readdir(path, function(error, names) {
        if (error) {
          throw error;
        }
        for (let name of names) {
            let _path = `${path}/${name}`
             result  = {...result,...marks(_path)};
        }
      });
      return result;
    }
    catch(error){
        return { error: error };
    }
}
